var obj = {
    a: 'a',
    b: 'b',
    c: 'a',
    d:function(){
        console.log('d')
    }
}
// 定义
Object.defineProperties(obj, {
    e1:{
        configurable: true,
        writable: true,
        value:'e1'
    },
    e2:{
        configurable: true,
        enumerable:true,
        get: function (){
            return  this.newaccpropvalue|| 'xxx'
        },
        set: function (newValue){
            this.newaccpropvalue = newValue
        }
    }
})
console.log(obj)
obj.e2 ='hahaha'

//  拷贝
var copyobj = Object.assign({}, obj)
console.log(copyobj)

// 新建
var createobj = Object.create(copyobj, {
    foo: {
        writable: true,
        configurable: true,
        value: 'hello'
    }
})
console.log(createobj)
console.log(createobj.a)

// 获取属性名
console.log(Object.getOwnPropertyNames(obj))
console.log(Object.getOwnPropertyNames(createobj))

// 获取指定对象的原型对象
console.log(Object.getPrototypeOf(obj))
console.log(Object.getPrototypeOf(createobj) === copyobj)

console.log(Object.keys(obj))
